/*
 *  1942.cpp
 *  1942reem
 *
 *  Created by James on 8/4/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#include "StdAfx.h"
#include "1942.h"
#include "../machine/1942Machine.h"

static dip_t dip1[] =
	{
	{"Coin 1",3,7,{{"4 coins/1 credit",1},{"3 coins/1 credits",2},{"2 coin/1 credits",4},{"1 coin/1 credit",7},{"2 coins/3 credits",3},{"1 coin/2 credits",6},{"1 coin/4 credits",5},{"free play",0}}},
	{"Cabinet",1,8,{{"upright",0},{"cocktail",8}}},
	{"Bonus Life",2,0x30,{{"30k 100k 100k+",0},{"30k 80k 80k+",0x10},{"20k 100k 100k+",0x20},{"20k 80k 80k+",0x30}}},
	{"Bonus Life",2,0xC0,{{"5",0x00},{"3",0xC0},{"2",0x40},{"1",0x80}}},
	{0,0,0,0,0}	
	};

static dip_t dip2[] =
	{
	{"Coin 2",3,7,{{"4 coins/1 credit",1},{"3 coins/1 credits",2},{"2 coin/1 credits",4},{"1 coin/1 credit",7},{"2 coins/3 credits",3},{"1 coin/2 credits",6},{"1 coin/4 credits",5},{"free play",0}}},
	{"Unknown",1,8,{{"off",0},{"on",8}}},
	{"Flip Screen",1,0x10,{{"on",0},{"off",1}}},
	{"Difficulty",2,0x60,{{"easy",0x49},{"normal",0x60},{"difficult",0x20},{"very difficult",0}}},
	{"Screen Stop",1,0x80,{{"on",0},{"off",0x80}}},
	{0,0,0,0,0}	
	};

InputPort c1942Port2 =
	{
		{
		{"Right",	I_RIGHT,		0x01,	I_LOW},
		{"Left",	I_LEFT,			0x02,	I_LOW},
		{"Down",	I_DOWN,			0x04,	I_LOW},
		{"Up",		I_UP,			0x08,	I_LOW},
		{"Button 1",I_B1,			0x10,	I_LOW},
		{"Button 2",I_B2,			0x20,	I_LOW},
		{"Unknown",	0,				0x40,	I_LOW},
		{"Unknown",	0,				0x80,	I_LOW},
		}
	};

InputPort c1942Port3 =
	{
		{
		{"Right",	I2_RIGHT,		0x01,	I_LOW},
		{"Left",	I2_LEFT,		0x02,	I_LOW},
		{"Down",	I2_DOWN,		0x04,	I_LOW},
		{"Up",		I2_UP,			0x08,	I_LOW},
		{"Button 1",I2_B1,			0x10,	I_LOW},
		{"Button 2",I2_B2,			0x20,	I_LOW},
		{"Unknown",	0,				0x40,	I_LOW},
		{"Unknown",	0,				0x80,	I_LOW},
		}
	};

InputPort c1942Port1 =
	{
		{
		{"Start 1",	I_START1,	0x01,	I_LOW},
		{"Start 2",	I_START2,	0x02,	I_LOW},
		{"Unknown",	0,			0x04,	I_LOW},
		{"Unknown",	0,			0x08,	I_LOW},
		{"Service",	I_SERVICE,	0x10,	I_LOW},
		{"Unknown",	0,			0x20,	I_LOW},
		{"Coin 2",	I_COIN2,	0x40,	I_LOW},
		{"Coin 1",	I_COIN1,	0x80,	I_LOW},
		}
	};

static highscore_t highscore[] =
	{
	{0x0033,0x27,0x00,0xFF},
	{0,-1}
	};

C1942::C1942()
{
	SetName("1942");							//set romset name
	SetScreen(256,256,ROTATE_270);
	SetHighScoreInfo(highscore);
	SetDip(0,dip1);
	SetDip(1,dip2);
	SetPort(0,&c1942Port1);
	SetPort(1,&c1942Port2);
	SetPort(2,&c1942Port3);

	//program roms
	AddROM("srb-03.m3", 0x00000,0x4000,0xd9dafcc3,ROM_CPU1);
	AddROM("srb-04.m4", 0x04000,0x4000,0xda0cf924,ROM_CPU1);
	AddROM("srb-05.m5", 0x10000,0x4000,0xd102911c,ROM_CPU1);
	AddROM("srb-06.m6", 0x14000,0x2000,0x466f8248,ROM_CPU1);
	AddROM("srb-07.m7", 0x18000,0x4000,0x0d31038c,ROM_CPU1);
	AddROM("sr-01.c11",	0x0000, 0x4000,0xbd87f06b,ROM_CPU2);

	//graphics
	AddROM("sr-02.f2",	0x0000, 0x2000,0x6ebca191,ROM_VROM1);
	AddROM("sr-08.a1",	0x0000, 0x2000,0x3884d9eb,ROM_VROM2);
	AddROM("sr-09.a2",	0x2000, 0x2000,0x999cf6e0,ROM_VROM2);
	AddROM("sr-10.a3",	0x4000, 0x2000,0x8edb273a,ROM_VROM2);
	AddROM("sr-11.a4",	0x6000, 0x2000,0x3a2726c3,ROM_VROM2);
	AddROM("sr-12.a5",	0x8000, 0x2000,0x1bd3d8bb,ROM_VROM2);
	AddROM("sr-13.a6",	0xA000, 0x2000,0x658f02c4,ROM_VROM2);
	AddROM("sr-14.l1",	0x00000,0x4000,0x2528bec6,ROM_VROM3);
	AddROM("sr-15.l2",	0x04000,0x4000,0xf89287aa,ROM_VROM3);
	AddROM("sr-16.n1",	0x08000,0x4000,0x024418f8,ROM_VROM3);
	AddROM("sr-17.n2",	0x0C000,0x4000,0xe2c7e489,ROM_VROM3);

	//proms
	AddROM("sb-5.e8",	0x0000, 0x0100,0x93ab8153,ROM_PROM);
	AddROM("sb-6.e9",	0x0100, 0x0100,0x8ab44f7d,ROM_PROM);
	AddROM("sb-7.e10",	0x0200, 0x0100,0xf4ade9a4,ROM_PROM);
	AddROM("sb-0.f1",	0x0300, 0x0100,0x6047d91b,ROM_PROM);
	AddROM("sb-4.d6",	0x0400, 0x0100,0x4858968d,ROM_PROM);
	AddROM("sb-8.k3",	0x0500, 0x0100,0xf6fad943,ROM_PROM);
	AddROM("sb-2.d1",	0x0600, 0x0100,0x8bb8b3df,ROM_PROM);
	AddROM("sb-3.d2",	0x0700, 0x0100,0x3b0c99af,ROM_PROM);
	AddROM("sb-1.k6",	0x0800, 0x0100,0x712ac508,ROM_PROM);
	AddROM("sb-9.m11",	0x0900, 0x0100,0x4921635c,ROM_PROM);
}

CMachine *C1942::CreateMachine()
{
	return(new C1942Machine());
}
